home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / cmds.fmt / lint.man < prev    next >
Encoding:
Text File  |  1989-02-05  |  5.8 KB  |  199 lines

  1.  
  2.  
  3.  
  4. LINT                      User Commands                      LINT
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      lint - a C program verifier
  10.  
  11. SSYYNNOOPPSSIISS
  12.      lliinntt [ --aabbcchhnnppuuvvxx ] file ...
  13.  
  14. DDEESSCCRRIIPPTTIIOONN
  15.      _L_i_n_t attempts to detect features of the C program _f_i_l_e_s
  16.      which are likely to be bugs, or non-portable, or wasteful.
  17.      It also checks the type usage of the program more strictly
  18.      than the compilers.  Among the things which are currently
  19.      found are unreachable statements, loops not entered at the
  20.      top, automatic variables declared and not used, and logical
  21.      expressions whose value is constant.  Moreover, the usage of
  22.      functions is checked to find functions which return values
  23.      in some places and not in others, functions called with
  24.      varying numbers of arguments, and functions whose values are
  25.      not used.
  26.  
  27.      By default, it is assumed that all the _f_i_l_e_s are to be
  28.      loaded together; they are checked for mutual compatibility.
  29.      Function definitions for certain libraries are available to
  30.      _l_i_n_t; these libraries are referred to by a conventional
  31.      name, such as `-lm', in the style of _l_d(1).  Arguments end-
  32.      ing in ._l_n are also treated as library files.  To create
  33.      lint libraries, use the --CC option:
  34.  
  35.           lint -Cfoo files . . .
  36.  
  37.      where _f_i_l_e_s are the C sources of library _f_o_o. The result is
  38.      a file _l_l_i_b-_l_f_o_o._l_n in the correct library format suitable
  39.      for linting programs using _f_o_o.
  40.  
  41.      Any number of the options in the following list may be used.
  42.      The --DD, --UU, and --II options of _c_c(1) are also recognized as
  43.      separate arguments.
  44.  
  45.      --aa        Report assignments of long values to int vari-
  46.                ables.
  47.  
  48.      --bb        Report _b_r_e_a_k statements that cannot be reached.
  49.                (This is not the default because, unfortunately,
  50.                most _l_e_x and many _y_a_c_c outputs produce dozens of
  51.                such comments.)
  52.  
  53.      --cc        Complain about casts which have questionable por-
  54.                tability.
  55.  
  56.      --hh        Apply a number of heuristic tests to attempt to
  57.                intuit bugs, improve style, and reduce waste.
  58.  
  59.      --mm_t_a_r_g_e_t  This switch is passed to the C preprocessor, and
  60.  
  61.  
  62.  
  63. Sprite v1.0              March 17, 1986                         1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. LINT                      User Commands                      LINT
  71.  
  72.  
  73.  
  74.                ensures that machine-dependent include files for
  75.                machine _t_a_r_g_e_t are used.
  76.  
  77.      --MM        Do not complain about multiply-defined procedures.
  78.                This switch is useful, for example, when linting a
  79.                library against its own lint library generated
  80.                with --CC.
  81.  
  82.      --nn        Do not check compatibility against the standard
  83.                library.
  84.  
  85.      --pp        Attempt to check portability to the _I_B_M and _G_C_O_S
  86.                dialects of C.
  87.  
  88.      --SS        Apply stricter Sprite coding standards.  With this
  89.                option, ``++'' and ``--'' are disallowed as side
  90.                effects inside other expressions, assignment is
  91.                not permitted inside iiff conditionals, and the
  92.                bodies of iiffs and other compound statements must
  93.                be enclosed in braces.
  94.  
  95.      --uu        Do not complain about functions and variables used
  96.                and not defined, or defined and not used (this is
  97.                suitable for running _l_i_n_t on a subset of files out
  98.                of a larger program).
  99.  
  100.      --vv        Suppress complaints about unused arguments in
  101.                functions.
  102.  
  103.      --xx        Report variables referred to by extern declara-
  104.                tions, but never used.
  105.  
  106.      --zz        Do not complain about structures that are never
  107.                defined (e.g.  using a structure pointer without
  108.                knowing its contents.).
  109.  
  110.      _E_x_i_t(2) and other functions which do not return are not
  111.      understood; this causes various lies.
  112.  
  113.      Certain conventional comments in the C source will change
  114.      the behavior of _l_i_n_t:
  115.  
  116.      /*NOTREACHED*/
  117.           at appropriate points stops comments about unreachable
  118.           code.
  119.  
  120.      /*VARARGS_n*/
  121.           suppresses the usual checking for variable numbers of
  122.           arguments in the following function declaration.  The
  123.           data types of the first _n arguments are checked; a
  124.           missing _n is taken to be 0.
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0              March 17, 1986                         2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. LINT                      User Commands                      LINT
  137.  
  138.  
  139.  
  140.      /*NOSTRICT*/
  141.           shuts off strict type checking in the next expression.
  142.  
  143.      /*ARGSUSED*/
  144.           turns on the --vv option for the next function.
  145.  
  146.      /*LINTLIBRARY*/
  147.           at the beginning of a file shuts off complaints about
  148.           unused functions in this file.
  149.  
  150. AAUUTTHHOORR
  151.      S.C. Johnson.  Lint library construction implemented by
  152.      Edward Wang.
  153.  
  154. FFIILLEESS
  155.      /usr/lib/lint/lint[12]      programs
  156.      /usr/lib/lint/llib-lc.ln    declarations for standard func-
  157.      tions
  158.      /usr/lib/lint/llib-lc       human readable version of above
  159.      /usr/lib/lint/llib-port.ln  declarations for portable func-
  160.      tions
  161.      /usr/lib/lint/llib-port     human readable . . .
  162.      llib-l*.ln                  library created with --CC
  163.  
  164. SSEEEE AALLSSOO
  165.      cc(1)
  166.      S. C. Johnson, _L_i_n_t, _a _C _P_r_o_g_r_a_m _C_h_e_c_k_e_r
  167.  
  168. BBUUGGSS
  169.      There are some things you just ccaann''tt get lint to shut up
  170.      about.
  171.  
  172.      /*NOSTRICT*/ is not implemented in the current version
  173.      (alas).
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. Sprite v1.0              March 17, 1986                         3
  196.  
  197.  
  198.  
  199.